package com.example.shoppingmall.service;

import com.example.shoppingmall.dao.OrderMapper;
import com.example.shoppingmall.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OrderService{
    @Autowired
    OrderMapper orderMapper;

    public List<Order> getOrderList(Integer orderId,String orderno, String date, String username, String phone, int pageno, int pageSize) {
        return orderMapper.getOrderList(orderId,orderno, date, username, phone, pageno, pageSize);
    }

    public int Count(Integer orderId,String orderno, String date, String username, String phone) {
        return orderMapper.Count(orderId,orderno, date, username, phone);
    }

    public Order selxq(Integer id){
        return orderMapper.selxq(id);
    }

    public int updorderpay(Integer paytype,Integer id){
        return orderMapper.updorderpay(paytype,id);
    }

    public int addinvoiceOrder(Invoice invoice){
        return orderMapper.addinvoiceOrder(invoice);
    }

    public int updorderstatus(Integer id){
        return orderMapper.updorderstatus(id);
    }

    public int updordersuccess(Integer id){
        return orderMapper.updordersuccess(id);
    }

    public int updOrder(Order order){
        return orderMapper.updOrder(order);
    }

    public int addbillpayment(Bill_payment bill_payment){
        return orderMapper.addbillpayment(bill_payment);
    }

    public OrderShop selalreadynum(Integer id){
        return orderMapper.selalreadynum(id);
    }

    public int updordershopnum(Integer already,Integer id){
        return orderMapper.updordershopnum(already,id);
    }

    public Order selordershopid(Integer id){
        return orderMapper.selordershopid(id);
    }

    public User getusermoney(String userAccount){
        return orderMapper.getusermoney(userAccount);
    }

    public int updusermoney(User user){
        return orderMapper.updusermoney(user);
    }
}
